Optimal. Leaf size=137 \[ -\frac {d^2 x}{4 a f^2}-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}-\frac {i d^2}{4 f^3 (a+i a \tan (e+f x))}+\frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3804, 3560, 8}
\begin {gather*} \frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}-\frac {i d^2}{4 f^3 (a+i a \tan (e+f x))}-\frac {d^2 x}{4 a f^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3560
Rule 3804
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx &=\frac {(c+d x)^3}{6 a d}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}-\frac {(i d) \int \frac {c+d x}{a+i a \tan (e+f x)} \, dx}{f}\\ &=-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}+\frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}-\frac {d^2 \int \frac {1}{a+i a \tan (e+f x)} \, dx}{2 f^2}\\ &=-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}-\frac {i d^2}{4 f^3 (a+i a \tan (e+f x))}+\frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}-\frac {d^2 \int 1 \, dx}{4 a f^2}\\ &=-\frac {d^2 x}{4 a f^2}-\frac {i (c+d x)^2}{4 a f}+\frac {(c+d x)^3}{6 a d}-\frac {i d^2}{4 f^3 (a+i a \tan (e+f x))}+\frac {d (c+d x)}{2 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^2}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.30, size = 178, normalized size = 1.30 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left ((d+(1+i) c f+(1+i) d f x) ((1+i) c f+d (-i+(1+i) f x)) \cos (2 f x) (\cos (e)-i \sin (e))+\frac {4}{3} f^3 x \left (3 c^2+3 c d x+d^2 x^2\right ) (\cos (e)+i \sin (e))-i (d+(1+i) c f+(1+i) d f x) ((1+i) c f+d (-i+(1+i) f x)) (\cos (e)-i \sin (e)) \sin (2 f x)\right )}{8 f^3 (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.56, size = 108, normalized size = 0.79
method | result | size |
risch | \(\frac {d^{2} x^{3}}{6 a}+\frac {d c \,x^{2}}{2 a}+\frac {c^{2} x}{2 a}+\frac {c^{3}}{6 d a}+\frac {i \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x -2 i d^{2} f x +2 c^{2} f^{2}-2 i c d f -d^{2}\right ) {\mathrm e}^{-2 i \left (f x +e \right )}}{8 a \,f^{3}}\) | \(108\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 107, normalized size = 0.78 \begin {gather*} \frac {{\left (6 i \, d^{2} f^{2} x^{2} + 6 i \, c^{2} f^{2} + 6 \, c d f - 3 i \, d^{2} - 6 \, {\left (-2 i \, c d f^{2} - d^{2} f\right )} x + 4 \, {\left (d^{2} f^{3} x^{3} + 3 \, c d f^{3} x^{2} + 3 \, c^{2} f^{3} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{24 \, a f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.17, size = 165, normalized size = 1.20 \begin {gather*} \begin {cases} \frac {\left (2 i c^{2} f^{2} + 4 i c d f^{2} x + 2 c d f + 2 i d^{2} f^{2} x^{2} + 2 d^{2} f x - i d^{2}\right ) e^{- 2 i e} e^{- 2 i f x}}{8 a f^{3}} & \text {for}\: a f^{3} e^{2 i e} \neq 0 \\\frac {c^{2} x e^{- 2 i e}}{2 a} + \frac {c d x^{2} e^{- 2 i e}}{2 a} + \frac {d^{2} x^{3} e^{- 2 i e}}{6 a} & \text {otherwise} \end {cases} + \frac {c^{2} x}{2 a} + \frac {c d x^{2}}{2 a} + \frac {d^{2} x^{3}}{6 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 123, normalized size = 0.90 \begin {gather*} \frac {{\left (4 \, d^{2} f^{3} x^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c d f^{3} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} f^{3} x e^{\left (2 i \, f x + 2 i \, e\right )} + 6 i \, d^{2} f^{2} x^{2} + 12 i \, c d f^{2} x + 6 i \, c^{2} f^{2} + 6 \, d^{2} f x + 6 \, c d f - 3 i \, d^{2}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{24 \, a f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.08, size = 241, normalized size = 1.76 \begin {gather*} \frac {12\,c^2\,f^3\,x-3\,d^2\,\sin \left (2\,e+2\,f\,x\right )+6\,c^2\,f^2\,\sin \left (2\,e+2\,f\,x\right )+4\,d^2\,f^3\,x^3+6\,c\,d\,f\,\cos \left (2\,e+2\,f\,x\right )+6\,d^2\,f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d\,f^3\,x^2+6\,d^2\,f\,x\,\cos \left (2\,e+2\,f\,x\right )+12\,c\,d\,f^2\,x\,\sin \left (2\,e+2\,f\,x\right )-d^2\,\cos \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+c^2\,f^2\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-c\,d\,f\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+d^2\,f^2\,x^2\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-d^2\,f\,x\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+c\,d\,f^2\,x\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}}{24\,a\,f^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________